﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Sublimation
{
    public class WhipBall : Projectile
    {
        public WhipBall(WorldProperties worldProperties, bool isFriendly, Vector2 position, Vector2 velocity, float maxSpeed, Vector2 size, float range, float damagePotential)
            : base(worldProperties, isFriendly, position, velocity, maxSpeed, size, range, damagePotential)
        {
        }


        protected override void LoadContent()
        {
            base.LoadContent();
            Sprite = Game.Content.Load<Texture2D>("Sprites/gall/gall_bullet");
            Scale = 1.0f;
        }

        public override void Update(GameTime gameTime)
        {
            if (velocity.Length() < maxSpeed * 0.3)
            {
                SelfDestruct();
            }
            base.Update(gameTime);
        }

        protected override void ExplosionAnimation(GameObject target)
        {
            new Animation(worldProperties, this, 0.4f, 5, 20, "Sprites/gall/bullet_hit_enemy");
        }

        public override void CheckCollisions(GameTime gameTime)
        {
            base.CheckCollisions(gameTime);
        }

    }
}
